#version 330 core
out vec4 FragColor;

in vec2 TexCoords;

uniform sampler2D Diff;
uniform sampler2D Shadow;

void main()
{             
  // retrieve data from gbuffer
  vec3 diffcolor = texture(Diff, TexCoords).rgb;
  float shadow = texture(Shadow, TexCoords).r;
  shadow = clamp((1.0 - shadow), 0.3, 1.0);
  vec3 lighting = diffcolor * shadow;
  FragColor = vec4(lighting, 1.0);
}